* **************************************************************************** *
* Sierra Leone - Social Signaling and Childhood Immunization    
* QJE Replication Master Dofile                                                *
* **************************************************************************** *
/*
** PURPOSE:     1.) Install all packages that this replication requires
				2.) Set estimation Settings
				3.) Set user file paths
				4.) Set replication folder globals
				5.) Change iebaltab package version 

*/
* **************************************************************************** *
* **************************************************************************** *

* Set to 1 to install all packages required to run the code:
local install_packages = 1

* ---------------------------------------------------------------------------- *
* 1.) Install all packages that this project requires
* ---------------------------------------------------------------------------- *

if  `install_packages' == 1 {

* Install all packages that this project requires:
local user_commands =  " ietoolkit fre texsave dataout matnames distinct randcmd binscatter blindschemes grstyle estout palettes colrspace" 

foreach command of local user_commands {
cap which `command'
if _rc == 111 {
ssc install `command' , replace
}
}
net install grc1leg, from(http://www.stata.com/users/vwiggins)
}

*Standardize settings accross users
ieboilstart, version(12.1)          //Set the version number to the oldest version used by anyone in the project team
`r(version)'                        //This line is needed to actually set the version from the command above


* ---------------------------------------------------------------------------- *
* 2.) Estimation Settings
* ---------------------------------------------------------------------------- *


global  RepsNum  = 1000
global  seed     = 1985

global  StarsOpt = "star(* 0.10 ** 0.05 *** 0.01)"
global  BalStars = "starsnoadd"



* ---------------------------------------------------------------------------- *
* 3.) Set User file paths
* ---------------------------------------------------------------------------- *


dis "`c(username)'"

* Anne
if c(username)=="annekaring" {
global Package     "/Users/annekaring/Library/CloudStorage/Box-Box/Sierra Leone/SocialSignaling/Immunization/SocialSignaling_Main/Reproducibility Package/QJE_Reproducibility_Package"
}


* Juliette
if c(username)=="juliettefinetti"  {
global Package "/Users/juliettefinetti/Library/CloudStorage/Box-Box/Sierra Leone/SocialSignaling/Immunization/SocialSignaling_Main/Reproducibility Package/QJE_Reproducibility_Package"
}

* Rachel
if c(username)=="rachelalper"  {
global Package "/Users/rachelalper/Library/CloudStorage/Box-Box/SocialSignaling/Immunization/SocialSignaling_Main/Reproducibility Package/QJE_Reproducibility_Package"
}

* ---------------------------------------------------------------------------- *
* 4.) Project folder globals
* ---------------------------------------------------------------------------- *


* **************************************************************************** *
* Replication Package Folders:

* - Social Signaling and Childhood Immunization - *


* Data folders:
global Replicate_SocialSignals_dta        "${Package}/Data"
global Replicate_SocialSignals_dtaInter   "${Replicate_SocialSignals_dta}/Intermediate"
global Replicate_SocialSignals_dtaFinal   "${Replicate_SocialSignals_dta}/Final"

global Replicate_SocialSignals_Matlab   "${Package}/Matlab"

* Output folders:
global Replicate_SocialSignals_Out        "${Package}/Output"
global Replicate_SocialSignals_Tables     "${Replicate_SocialSignals_Out}/Tables"
global Replicate_SocialSignals_Figures    "${Replicate_SocialSignals_Out}/Figures"

* Appendix-Output folders:
global Replicate_SocialSignals_OutApp     "${Replicate_SocialSignals_Out}/Appendix"
global Replicate_SocialSignals_ATables    "${Replicate_SocialSignals_OutApp}/Tables"
global Replicate_SocialSignals_AFigures   "${Replicate_SocialSignals_OutApp}/Figures"

*dofile
global Replicate_SocialSignals_dofiles     "${Package}/Dofiles"



* ---------------------------------------------------------------------------- *
* 5.) Change iebaltab package version
* ---------------------------------------------------------------------------- *


*This ado file replaces iebaltab command to be using version 6.4 to ensure proper table formatting
do "$Replicate_SocialSignals_dofiles/iebaltab.ado"

* **************************************************************************** *
* End of the Master Dofile !!!
* **************************************************************************** *



